package it.antonio.ilpizze.ioc.builders;

import it.antonio.ilpizze.ioc.Builder;
import it.antonio.ilpizze.ioc.Dependencies;


public class ConstantBuilder implements Builder<Object> {
	
	private Object key;
	private Object instance;
	
	public ConstantBuilder(Object key, Object instance) {
		this.key = key;
		this.instance = instance;
	}

	@Override
	public Object getKey() {
		return key;
	}

	@Override
	public Class<?> getType() {
		return instance.getClass();
	}

	@Override
	public Object build(Dependencies dependencies) {
		return instance;
	}
	@Override
	public String toString() {
		return "ConstantBuilder[" + getKey() + ":" + getType().getSimpleName() + "-" + instance.toString() + "]";
	}
	

}
